import {
  getCategoryList
} from '../../api/categoryApi.js'

export default {
  namespaced: true,
  state: {
    // 所有分类信息
    all_category_list: [],
    // 当前鼠标略过的一级分类ID
    current_category_id: -1
  },
  getters: {},
  mutations: {
    get_all_category_list (state, value) {
      state.all_category_list = value
    },
    set_current_category_id (state, value) {
      state.current_category_id = value
    }
  },
  actions: {
    get_all_category_list (context) {
      getCategoryList({}).then(response => {
        console.log(response)
        context.commit('get_all_category_list', response.data.data)
      })
    }
  },
  modules: {}
}
